@extends('web.layouts.app')

@section('title', trans('seo.articles.title'))
@section('keywords', trans('seo.articles.keywords'))
@section('description', trans('seo.articles.description'))

@section('styles')
  <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/information.css')}}">
@endsection

@section('content')
  <div class="information-category">
    <ul>
      @foreach($article_child_categories as $article_child_category)
        <li {{ $article_child_category->name==$query_article_category->name?"class=active":""}}><a
                  href="{{ action("ArticleController@list",[$article_child_category->id]) }}">{{$article_child_category->name}}</a>
        </li>
      @endforeach
    </ul>
  </div>
  <div class="information-wrap clearfix">
    <div class="information-main">
      <div class="information-block-title">文章列表</div>
      <ul class="information-list">
        @foreach($articles as $article)
          <li>
            <h2>
              <a href="{{ action("ArticleController@article_information_info",[$article->id])  }}">{{ str_limit($article->title,50) }}</a>
            </h2>
            <dl class="dl">
              <dt class="dt"><img
                        src="{{ asset(empty($article->image)?"resources/web/images/article_default.jpg":$article->image,270,150) }}"
                        height="150" width="270"></dt>
              <dd class="dd">
                <div class="author"><a class="author" href="#"
                                       target="_blank">{{ $article->author }}</a><span>{{ $article->published_at }}</span>
                </div>
                <p>{{ str_limit($article->description,150) }}<a class="read-all"
                                                                href="{{ action("ArticleController@article_information_info",[$article->id]) }}">全文
                    >>></a></p>
              </dd>
            </dl>
            <div class="tips">
              @foreach(explode(',', $article->tags) as $tag)
                @if(!empty($tag))

                  <label class="tag"><a
                            href="{{ action('ArticleController@article_query',['article_type_id'=>$query_article_category->id,'tag'=>$tag]) }}">{{ $tag }}</a></label>
                @endif
              @endforeach
            </div>
          </li>
        @endforeach
      </ul>
      <div class="information-page com-page-bar">
        <ul>

          {!!$articles->render()!!}
        </ul>
      </div>
    </div>
    <div class="information-side">
      <dl class="information-side-banner">
        <dt>{{ $ad1[0]->name }}</dt>
        <dd><a href="{{ $ad1[0]->link }}"><img src="{{ asset($ad1[0]->image,230,135) }}" height="135"
                                               width="230"></a></dd>
      </dl>
      <div class="information-side-list mt20">
        <div class="information-block-title">推荐文章</div>
        <ul>
          @foreach($query_article_category->get_recommend_articles(8) as $recommend)
            <li>
              <a href="{{ action("ArticleController@article_information_info",[$recommend->id]) }}">{{ str_limit($recommend->title,25) }}</a>
            </li>
          @endforeach
        </ul>
      </div>
      <dl class="information-side-banner pt20">
        <dt>{{ $ad2[0]->name }}</dt>
        <dd><a href="{{ $ad2[0]->link }}"><img src="{{ asset($ad2[0]->image,230,90) }}" height="90" width="230"></a>
        </dd>
      </dl>
    </div>
  </div>
@endsection